var g_gameDataManager = {
    initData:function()
    {
        var userName =cc.sys.localStorage.getItem("userName");
        if(userName == null) userName="";
        this.userName = userName;

        var userID =cc.sys.localStorage.getItem("userID");
        if(userID == null) userID=-1;
        this.userID = parseInt(userID);

        var pwd = cc.sys.localStorage.getItem("pwd");
        if(pwd == null) pwd="";
        this.password=pwd;
    },

    getUserName:function()
    {
        return this.userName;
    },

    setUserName:function(userName)
    {
        cc.sys.localStorage.setItem("userName",userName);
        this.userName=userName;
    },

    getUserID:function()
    {
        return this.userID;
    },

    setUserID:function(userID)
    {
        cc.sys.localStorage.setItem("userID",userID);
        this.userID = userID;
    },

    getUserPassword: function ()
    {
        return this.password;
    },

    setUserPassword:function(pwd)
    {
        cc.sys.localStorage.setItem("pwd",pwd);
        this.password = pwd;
    },
};
// GameData._instance = null;
// GameData.getInstance = function()
// {
//     if(GameData._instance == null)
//     {
//         GameData._instance = new GameData();
//         GameData._instance.initData();
//     }
//     return GameData._instance;
// };

g_gameDataManager.initData();
module.exports = g_gameDataManager;